import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/cloud-system/userLogin',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/cloud-system/userInfo',
    method: 'post',
    data: { token: token }
  })
}

export function logout(data) {
  return request({
    url: '/cloud-system/userLogout',
    method: 'post',
    data
  })
}

export function fetchUserList(data) {
  return request({
    url: '/cloud-system/getUserList',
    method: 'post',
    data
  })
}

export function fetchUserOne(data) {
  return request({
    url: '/cloud-system/getOneUserDetail',
    method: 'post',
    data
  })
}

export function createUser(data) {
  return request({
    url: '/cloud-system/createOneUser',
    method: 'post',
    data
  })
}

export function updateUser(data) {
  return request({
    url: '/cloud-system/updateOneUser',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/cloud-system/deleteOneUser',
    method: 'post',
    data
  })
}

export function lockUser(data) {
  return request({
    url: '/cloud-system/lockOneUser',
    method: 'post',
    data
  })
}

export function unlockUser(data) {
  return request({
    url: '/cloud-system/unlockOneUser',
    method: 'post',
    data
  })
}

export function userBrowserInfo() {
  return request({
    url: '/cloud-system/userBrowserInfo',
    method: 'get'
  })
}

